require(["common", "jQuery", "coAjax", "href", "hash_routie", "eventManager", "queryString"], function(jSouper, $, coAjax, href, hash_routie, eventManager, QueryString) {
	hash_routie.on("point", function() {
		var queryString = new QueryString(location.hash);
		var _type = queryString.get("type");
		if (_type == 2) {
			App.set('title', '导购链接');
			App.set('infotype', 'shoppinguide')
			coAjax.get(appConfig.user.guide_list, function(result) {
				console.log(result.result);
				App.set("$Cache.user.guide_list", result.result);
			});
		} else {
			App.set('infotype', '')
			coAjax.get(appConfig.user.bus_bind, function(result) {
				console.log(result.result);
				App.set("bus_user_bind", result.result);
			});
			App.set('title', '推荐返利');

		}
	});
	// 导购
	App.set("$Event.user.guide.weishenqingduihuan_to_shenqingduihuanzhong", function(e, vm) {
		coAjax.put(appConfig.user.guide_weishenqingduihuan_to_shenqingduihuanzhong, {
			bus_id: vm.get("bus_id")
		}, function(result) {
			console.log(result.result);
			vm.set(result.result);
		})
	});
	App.set("$Ev ent.user.guide.shangjiayijingfukuan_to_yonghuquerenfukuan", function(e, vm) {
		coAjax.put(appConfig.user.guide_shangjiayijingfukuan_to_yonghuquerenfukuan, {
			bus_id: vm.get("bus_id")
		}, function(result) {
			console.log(result.result);
			vm.set(result.result);
		})
	});
	//推荐返利
	App.set("$Event.user.weishenqingduihuan_to_shenqingduihuanzhong", function(e, vm) {
		coAjax.put(appConfig.user.res_weishenqingduihuan_to_shenqingduihuanzhong, {
			bus_id: vm.get("bus_id")
		}, function(result) {
			console.log(result.result);
			vm.set(result.result);
		})
	})

	App.set("$Event.user.shangjiayijingfukuan_to_yonghuquerenfukuan", function(e, vm) {
		coAjax.put(appConfig.user.res_shangjiayijingfukuan_to_yonghuquerenfukuan, {
			bus_id: vm.get("bus_id")
		}, function(result) {
			console.log(result.result);
			vm.set(result.result);
		})
	});
});